% Stereographic and cylindrical map projections
% Author: Tomasz M. Trzeciak
% Source: LaTeX-Community.org
%         <http://www.latex-community.org/viewtopic.php?f=4&t=2111>
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,fadings,decorations.pathreplacing}
\usepackage{verbatim}


\tikzset{%
  >=latex, % option for nice arrows
  inner sep=0pt,%
  outer sep=2pt,%
  mark coordinate/.style={inner sep=0pt,outer sep=0pt,minimum size=3pt,
    fill=black,circle}%
}

\begin{document}



\begin{tikzpicture}[-]
\draw (0,0) -- (2,3);
\draw (2,3) -- (9,2);
\draw (9,2) -- (7,-1);
\draw (7,-1) -- (0,0);
\draw (1,0.5) -- (8,2);
\coordinate (vectX) at (7,-1);
\coordinate (vect1) at (8,2);
\coordinate[mark coordinate] (0) at (1,0.5);
\coordinate[mark coordinate] (Y) at (6,5);
\coordinate[mark coordinate] (Xbeta) at (6,0);
\coordinate[mark coordinate] (tildeX) at (5.5,1.5);
\path (vectX) +(0.4ex,-0.4ex) node[below] {$vect(X)$};
\path (vect1) +(0.4ex,-0.4ex) node[below] {$vect(1,\dots,1)$};
\path (0) +(0.4ex,-0.4ex) node[below] {$0$};
\path (Y) +(0.4ex,-0.4ex) node[below] {$Y$};
\path (Xbeta) +(0.4ex,-0.4ex) node[below] {$X\hat \beta$};
\path (tildeX) +(0.4ex,-0.4ex) node[below] {$\tilde X\hat \mu$};
\draw[->] (0) -- (Y) ;
\draw[->] (Y) -- (Xbeta) ;
\draw[->] (Y) -- (tildeX) ;
\end{tikzpicture}
%\begin{tikzpicture} % MERC

%% some definitions

%\def\R{3} % sphere radius
%\def\angEl{25} % elevation angle
%\def\angAz{-100} % azimuth angle
%\def\angPhiOne{-50} % longitude of point P
%\def\angPhiTwo{-35} % longitude of point Q
%\def\angBeta{33} % latitude of point P and Q

%% working planes

%\pgfmathsetmacro\H{\R*cos(\angEl)} % distance to north pole
%\LongitudePlane[xzplane]{\angEl}{\angAz}
%\LongitudePlane[pzplane]{\angEl}{\angPhiOne}
%\LongitudePlane[qzplane]{\angEl}{\angPhiTwo}
%\LatitudePlane[equator]{\angEl}{0}

%% draw background sphere

%\fill[ball color=white] (0,0) circle (\R); % 3D lighting effect
%\fill[white] (0,0) circle (\R); % just a white circle
%\draw (0,0) circle (\R);

%% characteristic points

%\coordinate (O) at (0,0);
%\coordinate[mark coordinate] (N) at (0,\H);
%\coordinate[mark coordinate] (S) at (0,-\H);
%\path[xzplane] (\R,0) coordinate (XE);
%\path[pzplane] (\angBeta:\R) coordinate (P);
%\path[pzplane] (\R,0) coordinate (PE);
%\path[qzplane] (\angBeta:\R) coordinate (Q);
%\path[qzplane] (\R,0) coordinate (QE);

%% meridians and latitude circles

% \DrawLongitudeCircle[\R]{\angAz} % xzplane
% \DrawLongitudeCircle[\R]{\angAz+90} % yzplane
%\DrawLongitudeCircle[\R]{\angPhiOne} % pzplane
%\DrawLongitudeCircle[\R]{\angPhiTwo} % qzplane
%\DrawLatitudeCircle[\R]{\angBeta}
%\DrawLatitudeCircle[\R]{0} % equator

% shifted equator in node with nested call to tikz
% (I didn't know it's possible)
%\node at (0,1.6*\R) { \tikz{\DrawLatitudeCircle[\R]{0}} };

%% draw lines and put labels

%\draw (-\R,-\H) -- (-\R,2*\R) (\R,-\H) -- (\R,2*\R);
%\draw[->] (XE) -- +(0,2*\R) node[above] {$y$};
%\node[above=8pt] at (N) {$\mathbf{N}$};
%\node[below=8pt] at (S) {$\mathbf{S}$};
%\draw[->] (O) -- (P);
%\draw[dashed] (XE) -- (O) -- (PE);
%\draw[dashed] (O) -- (QE);
%\draw[pzplane,->,thin] (0:0.5*\R) to[bend right=15]
%    node[midway,right] {$\beta$} (\angBeta:0.5*\R);
%\path[pzplane] (0.5*\angBeta:\R) node[right] {$\hat{1}$};
%\path[qzplane] (0.5*\angBeta:\R) node[right] {$\hat{2}$};
%\draw[equator,->,thin] (\angAz:0.5*\R) to[bend right=30]
%    node[pos=0.4,above] {$\phi_1$} (\angPhiOne:0.5*\R);
%\draw[equator,->,thin] (\angAz:0.6*\R) to[bend right=35]
%    node[midway,below] {$\phi_2$} (\angPhiTwo:0.6*\R);
%\draw[equator,->] (-90:\R) arc (-90:-70:\R) node[below=0.3ex] {$x = a\phi$};
%\path[xzplane] (0:\R) node[below] {$\beta=0$};
%\path[xzplane] (\angBeta:\R) node[below left] {$\beta=\beta_0$};

%\end{tikzpicture}


%\begin{tikzpicture} % KART

%\def\R{2.5}

%\node[draw,minimum size=2cm*\R,inner sep=0,outer sep=0,circle] (C) at (0,0) {};
%\coordinate (O) at (0,0);
%\coordinate[mark coordinate] (Phat) at (20:2.5*\R);
%\coordinate (T1) at (tangent cs: node=C, point={(Phat)}, solution=1);
%\coordinate (T2) at (tangent cs: node=C, point={(Phat)}, solution=2);
%\coordinate[mark coordinate] (P) at ($(T1)!0.5!(T2)$);

%\draw[dashed] (T1) -- (O) -- (T2) -- (Phat) -- (T1) -- (T2);
%\draw[<->] (0,1.5*\R) node[above] {$y$} |- (2.5*\R,0) node[right] {$x$};
%\draw (O) node[below left] {$\mathbf{O}$} -- (P)
%    +(1ex,0) node[above=1ex] {$\mathbf{P}$};
%\draw (P) -- (Phat) node[above=1ex] {$\mathbf{\hat{P}}$};

%\end{tikzpicture}

\end{document} 